package wikitools.model;

public class IdManager {
    private Class category;
    private int curId;
    
    public IdManager(Class type){
        curId = 0;
        this.setCategory(type);
    }
    
    public IdManager(Class type, int id) {
        curId = id;
        this.setCategory(type);
    }
    
    public int newId() {
        curId += 1;
        return curId;
    }

    public void setCategory(Class category) {
        this.category = category;
    }

    public Class getCategory() {
        return category;
    }
    
    public String toString() {
        return "IdMan: " + this.category.toString() + ": " + this.curId;
    }
}


